import { useState } from "react";

const useCounter = () => {
    const [count, setCount] = useState(0);
    const increment = (value) => {
        setCount((count) => count + value);
    };
    const decrement = (value) => {
        setCount((count) => count - value);
    };
    return { count, increment, decrement };
};

export default useCounter;
